import Vue from 'vue'
import VueRouter from 'vue-router'
import BookUpdate from "@/views/BookUpdate";
import Index from "@/views/Index"
import BookSelect from "@/views/BookSelect";
import BookAdd from "@/views/BookAdd";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: '图书管理',
    component: Index,
    children: [
      {
        path: '/bookSelect',
        name: '查询图书',
        component: BookSelect
      },
      {
        path: '/bookAdd',
        name: '添加图书',
        component: BookAdd
      },
      {
        path: '/bookUpdate',
        name: '图书编辑',
        component: BookUpdate
      }
    ]
  }

  /*{
    path: '/navigation',
    name: '书籍编辑',
    component: Index,
    children: [
      {
        path: '/bookUpdate',
        name: '信息修改',
        component: BookUpdate
      },
      {
        path: '/bookDelete',
        name: '删除书籍',
        component: BookDelete
      },
    ]
  }*/
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
